﻿using System.Windows.Media;
using System.Windows.Media.Imaging;
using Common;
using ImageProcessing.Common;
using ImageProcessing.Storage;

namespace Visualizers.DataModels
{
    public class TagInfoDataModel
    {
        private static readonly OnlineImageArchiver OnlineImageArchiver = new OnlineImageArchiver();
        private readonly TagInfo _tagInfo;
        public TagInfo TagInfo { get { return _tagInfo; } }

        public string TagName { get { return _tagInfo.TagName; } }
        public string TagId { get { return _tagInfo.TagId.ToString(); } }

        public WriteableBitmap Thumbnail { get; private set; }

        public TagInfoDataModel(TagInfo tagInfo)
        {
            _tagInfo = tagInfo;
            Thumbnail = HelperMethods.LoadImage(tagInfo.TagId.ToString() + HelperMethods.RawFileExtension, PixelFormats.Gray8);
        }
    }
}
